/**
 * 
 */
package com.Hib.Domain;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Ignatiues charles arun
 * 
 *         Aug 29, 2010
 */

/*
 * To Demonstrate the saveorUpdate in Hibernate Recepies book
 */
public class Book2 implements Serializable
	{

		private Long isbn;

		private String name;

		private Date publishDate;

		/**
		 * @return the isbn
		 */
		public Long getIsbn()
			{
				return isbn;
			}

		/**
		 * @param isbn
		 *            the isbn to set
		 */
		public void setIsbn(Long isbn)
			{
				this.isbn = isbn;
			}

		/**
		 * @return the name
		 */
		public String getName()
			{
				return name;
			}

		/**
		 * @param name
		 *            the name to set
		 */
		public void setName(String name)
			{
				this.name = name;
			}

		/**
		 * @return the publishDate
		 */
		public Date getPublishDate()
			{
				return publishDate;
			}

		/**
		 * @param publishDate
		 *            the publishDate to set
		 */
		public void setPublishDate(Date publishDate)
			{
				this.publishDate = publishDate;
			}

		//		
		// /*
		// * (non-Javadoc)
		// *
		// * @see java.lang.Object#hashCode()
		// */
		// @Override
		// public int hashCode()
		// {
		//		
		// return new HashCodeBuilder().append(isbn).toHashCode();
		// }
		//		
		// /*
		// * (non-Javadoc)
		// *
		// * @see java.lang.Object#equals(java.lang.Object)
		// */
		// @Override
		// public boolean equals(Object obj)
		// {
		// if (!(obj instanceof Book2))
		// return false;
		// Book2 other = (Book2) obj;
		// return new EqualsBuilder().append(isbn, other.isbn).isEquals();
		//		
		// }

		/*
		 * (non-Javadoc)
		 * 
		 * @see java.lang.Object#hashCode()
		 */
		@Override
		public int hashCode()
			{
				final int prime = 31;
				int result = 1;
				result = prime * result
						+ ((isbn == null) ? 0 : isbn.hashCode());
				return result;
			}

		/*
		 * (non-Javadoc)
		 * 
		 * @see java.lang.Object#equals(java.lang.Object)
		 */
		@Override
		public boolean equals(Object obj)
			{
				if (this == obj)
					return true;
				if (obj == null)
					return false;
				if (!(obj instanceof Book2))
					return false;
				Book2 other = (Book2) obj;
				if (isbn == null)
					{
						if (other.isbn != null)
							return false;
					} else if (!isbn.equals(other.isbn))
					return false;
				return true;
			}

	}
